package com.chiaching.framwork.domian.bean;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;

/**
 * @author jiajing.he
 * @date 2021/7/27 上午10:55
 */
@Data
public class SuperMallUserDetail implements UserDetails , Serializable {

    private Long id;

    private String username;

    private String password;
    /**
     * 昵称
     */
    private String nickname;


    /**
     * 已有的登录令牌
     */
    private String oldToken;



    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return Collections.emptySet();
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
